package com.uzai.common.enums;

/**
 *
 * 卡密状态(0=入库；1=出库；2=作废)
 * @Auther: xiaoyuexl
 * @Date: 2021/8/13 11:31
 * @Description:
 */
public enum CdkeysStatusEnum {
    STOCK(0,"库存"),
    OUTSTOCK(1,"出库"),
    INVALID(2,"无效"),
    USED(3,"使用"),
    ;

    private Integer id;
    private String desc;

    CdkeysStatusEnum(Integer id, String desc) {
        this.id = id;
        this.desc = desc;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static CdkeysStatusEnum getById(Integer id) {
        if (id == null) {
            return null;
        }
        for (CdkeysStatusEnum type: CdkeysStatusEnum.values()) {
            if (type.getId().intValue() == id) {
                return type;
            }
        }
        return null;
    }
}
